package com.zycfc.zsf.boot.exception;

public class ExceptionInfo
{
    private final String code;
    private final String message;
    private Throwable throwable;
    
    public ExceptionInfo(final String code, final String message) {
        this.code = code;
        this.message = message;
    }
    
    public String getCode() {
        return this.code;
    }
    
    public String getMessage() {
        return this.message;
    }
    
    public Throwable getThrowable() {
        return this.throwable;
    }
    
    public void setThrowable(final Throwable throwable) {
        this.throwable = throwable;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof ExceptionInfo)) {
            return false;
        }
        final ExceptionInfo other = (ExceptionInfo)o;
        if (!other.canEqual(this)) {
            return false;
        }
        final Object this$code = this.getCode();
        final Object other$code = other.getCode();
        Label_0065: {
            if (this$code == null) {
                if (other$code == null) {
                    break Label_0065;
                }
            }
            else if (this$code.equals(other$code)) {
                break Label_0065;
            }
            return false;
        }
        final Object this$message = this.getMessage();
        final Object other$message = other.getMessage();
        Label_0102: {
            if (this$message == null) {
                if (other$message == null) {
                    break Label_0102;
                }
            }
            else if (this$message.equals(other$message)) {
                break Label_0102;
            }
            return false;
        }
        final Object this$throwable = this.getThrowable();
        final Object other$throwable = other.getThrowable();
        if (this$throwable == null) {
            if (other$throwable == null) {
                return true;
            }
        }
        else if (this$throwable.equals(other$throwable)) {
            return true;
        }
        return false;
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof ExceptionInfo;
    }
    
    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $code = this.getCode();
        result = result * 59 + (($code == null) ? 43 : $code.hashCode());
        final Object $message = this.getMessage();
        result = result * 59 + (($message == null) ? 43 : $message.hashCode());
        final Object $throwable = this.getThrowable();
        result = result * 59 + (($throwable == null) ? 43 : $throwable.hashCode());
        return result;
    }
    
    @Override
    public String toString() {
        return "ExceptionInfo(code=" + this.getCode() + ", message=" + this.getMessage() + ", throwable=" + this.getThrowable() + ")";
    }
}
